K2 BLACKPEARL PRODUCT DOCUMENTATION: USER GUIDE
For Each Event Wizard

For Each Wizard

What does it do?

The For Each wizard creates dynamic reference and index fields to loop through items from an item collection.

How is it used?

The For Each wizard can be used in any scenario where an item collection must be converted into a list of items items where something must be to done to each item in the list. This wizard is typically used in conjunction with the Create Reference wizard. The source list can be one of the following:

Prerequisites

If an Item Reference or item collection is used as the source list of items, this must exist before dragging the For Each wizard onto the canvas.

Configure the list to loop through

Provide the Source, Reference and Index for use in the creation of the list.

 

Field Description Sample Value
Source The source list to loop through. It can be one of the following:
  • An Item Reference created in the workflow. The Item Reference must contain a list or collection of items. 
  • An item collection from the Context Browser
  • A semicolon-delimited text
Select a value from the drop down list, type semicolon-delimited text or drag and drop a field from the Context Browser. Click the toggle button to change the type of input
Reference The name of the Reference to be created. The field is auto-populated using the SmartObject selected. Specify another name if required Type text in the field
Index The Index name used to create a Data Field Field which in turn serves as a unique identifier for each item in the list in order for the wizard to keep track of the items. The workflow automatically creates two outcomes for the For Each wizard (see next section for example):
  • Next Item - Index field used to determine if there is a next item
  • No More Items - Index field used to determine if there are no remaining items
Type text in the field. No user actions are required to create the outcomes

Automatically generated outcomes

The For Each wizard automatically creates two outcomes as part of the workflow. These outcomes are used to determine whether the loop should continue or not.

Outcome rules are created for each outcome. As long as the outcome rule for the Next Item resolves to true, the loop will continue.   

How to use the For Each wizard

It is important to take note of the steps to follow when using the For Each wizard as failing to do so might result in unexpected behavior. The next steps can be followed as a guide to complete the set up of the For Each wizard:

Considerations

 

 


K2 blackpearl Help 4.6.11 (4.12060.1731.0)